﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace 路由事件 {
    /// <summary>
    /// 隧道路由事件.xaml 的交互逻辑
    /// </summary>
    public partial class 隧道路由事件 : Window {
        public 隧道路由事件() {
            InitializeComponent();
        }

        private int eventCounter = 0;

        private void SomeKeyPressed(object sender, RoutedEventArgs e) {
            eventCounter++;
            var message = $"#{eventCounter.ToString()}:\r\n Sender:{sender.ToString()}\r\n Source:{e.Source}\r\n OriginalSource:{e.OriginalSource}\r\n Event:{e.RoutedEvent}";
            fstMessage.Items.Add(message);
            e.Handled = (bool)chkHandle.IsChecked;
        }

        private void cmdClear_Click(object sender, RoutedEventArgs e) {
            eventCounter = 0;
            fstMessage.Items.Clear();
        }
    }
}
